//
//  SampuxListViewCell.m
//  Sampux
//
//  Created by rzm on 16/7/5.
//  Copyright © 2016年 rzm. All rights reserved.
//

#import "SampuxListViewCell.h"

@implementation SampuxListViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self setupSubView];
    }
    return self;
}

- (void)setupSubView
{
    UIView *backView = [[UIView alloc]initWithFrame:CGRectMake(10, 10, self.width - 20, self.height - 20)];
    [self addSubview:backView];
    
    _heatingCondition = [UIButton createButton];
    [backView addSubview:_heatingCondition];
    _heatingCondition.frame = CGRectMake(0, 0, backView.height, backView.height);

    
    _equipmentName = [UILabel createLabelWithFrame:CGRectMake(_heatingCondition.right, 10, 100, 22)];
    [backView addSubview:_equipmentName];
    
    _stateImg = [UIButton createButton];
    [backView addSubview:_stateImg];
    _stateImg.frame = CGRectMake(_equipmentName.x, _equipmentName.bottom, 20, 20);
    
    _timeLab = [UILabel createLabelWithFrame:CGRectMake(self.width - 60, 10, 60, 22)];
    [backView addSubview:_timeLab];
    _timeLab.textAlignment = NSTextAlignmentRight;
    
    _tempLab = [UILabel createLabelWithFrame:CGRectMake(self.width - 20, _timeLab.bottom, 20, 20)];
    [backView addSubview:_tempLab];
    _tempLab.textAlignment = NSTextAlignmentRight;
    
    
    _arrowBtn = [UIButton createButton];
    _arrowBtn.frame = CGRectMake(0, 0, self.width, self.height);
    [_arrowBtn setImage:imageNamed(@"lock") forState:UIControlStateNormal];
    _arrowBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
    [backView addSubview:_arrowBtn];
    [UIView createLineViewInbottom:self];
}


@end
